<?
if (! $var_user->isAuthenticated()) {
    ?>
    <a href="<?= $var_webPrefix ?>admin/"><?= $this->translate('Log In')?></a>
    <?
    return;
}

// dependency

$tim = (int)YZ_TIME;
$exp = \Yz_Session_Default::SESSION_EXPIRES;
$js = <<<js
Yz.jquery(function(){
    $(function(){
        Yz.loadClass("Yz.Session", function() {Yz.Session.startTimer({$tim}, {$exp});} );
    })
});
js;
$this->includeJS(
    'yz-timer',
    $js
);
?>
<div class="yz-user-info">
    <div><?= $this->translate("Account:") ?> <?= $var_username ?></div>
    <a href="<?= $var_webPrefix ?>users/logout/"><?= $this->translate('Log Out')?></a>
    <div><?= $this->translate("IP Address:") ?> <?= $var_IPAddress ?></div>
    <div><?= $this->translate("Current time:") ?> <span id="yz-admin-time"></span></div>
    <div><?= $this->translate("Session expires in:") ?> <span id="yz-admin-session-expires"></span></div>
</div>

